<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" th:replace="layouts/master(title='学生列表')">
<th:block th:fragment="css">
    <link rel="stylesheet" href="/css/list.css">
</th:block>

<div th:fragment="content">
    <h1>学生列表</h1>
    <div class="input-group mb-3">
        <input type="text" class="form-control" placeholder="输入姓名" id="searchName">
        <div class="input-group-append">
            <button class="btn btn-primary" type="button" id="searchButton">查询</button>
        </div>
    </div>
    <show>
        <div class="row">
            <table class="table table-striped">
                <thead>
                <tr>
                    <th>id</th>
                    <th>name</th>
                    <th>score</th>
                </tr>
                </thead>
                <tbody id="students">
                <!-- Thymeleaf 迭代学生数据 -->
                <tr th:each="student : ${students}">
                    <td th:text="${student.id}">学生id</td> <!-- 学生id -->
                    <td th:text="${student.no}">学生学号</td>
                    <td th:text="${student.name}">学生姓名</td> <!-- 学生姓名 -->
                    <td th:text="${student.password}">学生密码</td>
                    <td th:text="${student.sex}">学生性别</td>
                    <td th:text="${student.age}">学生年龄</td>
                    <td th:text="${student.score}">学生成绩</td><!-- 学生成绩 -->
                </tr>
                </tbody>
            </table>
        </div>
    </show>
</div>

<div th:fragment="scripts">
    <script type="text/javascript" src="/pagejs/js/list1.js"></script>
</div>
</html>
